//
//  WaterFallCollectionViewLayout.h
//  TestPrj
//
//  Created by 朱铅峰 on 2019/11/11.
//  Copyright © 2019 Xing. All rights reserved.
//

#import <UIKit/UIKit.h>

@class WaterFallCollectionViewLayout;

@protocol WaterFallCollectionViewLayoutDelegate <NSObject>

@required

/**
 * 每个item的高度
 */
- (CGFloat)waterFallLayout:(WaterFallCollectionViewLayout *)waterFallLayout heightForItemAtIndexPath:(NSUInteger)indexPath itemWidth:(CGFloat)itemWidth;

@optional
/**
 * 有多少列
 */
- (NSUInteger)columnCountInWaterFallLayout:(WaterFallCollectionViewLayout *)waterFallLayout;

/**
 * 每列之间的间距
 */
- (CGFloat)columnMarginInWaterFallLayout:(WaterFallCollectionViewLayout *)waterFallLayout;

/**
 * 每行之间的间距
 */
- (CGFloat)rowMarginInWaterFallLayout:(WaterFallCollectionViewLayout *)waterFallLayout;

/**
 * 每个item的内边距
 */
- (UIEdgeInsets)edgeInsetdInWaterFallLayout:(WaterFallCollectionViewLayout *)waterFallLayout;

@end

@interface WaterFallCollectionViewLayout : UICollectionViewLayout

/**
 * 代理
 */
@property (nonatomic, weak) id<WaterFallCollectionViewLayoutDelegate> delegate;

@end
